package com.xinzhilibrary.model;

import com.sun.jndi.ldap.spi.LdapDnsProvider;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.ArrayList;

@Data
@AllArgsConstructor
public class Result {
    private String message;
    private Integer code;
    private Object data;

    private Result() {}
    public static Result success() {
        return new Result("成功", 200, null);
    }

    public static Result success(Object data) {
        return new Result("成功", 200, data /*此处的data应为GoodsTable类的实例*/);
    }

    public static Result error(String message) {
        return new Result(message, 500, message);
    }
    public static Result error401(String message) {
        return new Result(message, 401, "您当前的身份验证失效");
    }
}

